Floating point representations of numbers are useful in computing systems for supporting a wider range of values than can be supported in integer or fixed point formats. In floating point numbers, the radix point (decimal/binary) is allowed to “float,” which makes it possible to encode a wide range of values using a small number of bits. Because of the wide range, many floating point numbers may not be effectively represented in fixed point formats without a serious loss of precision or sometimes, errors/exceptions.
Some modern processors support floating point instructions which may operate on numbers represented in floating point format. Integrating floating point instructions in integer/fixed point processor pipelines presents challenges. For example, the potential loss of precision poses challenges in encoding floating point constants or immediate values in floating point instructions.
Traditional instruction set architectures (ISA) for computer processors commonly include instructions which specify an immediate value. Usually, instructions which specify an immediate value contain the immediate value within the instruction itself, in a designated field of the instruction. The number of bits available for immediate value fields in instructions is quite small, usually much smaller than the bit-width of the instruction. Accordingly, floating point instructions may not be able to accurately specify floating point immediate values in immediate value fields of small bit-widths. Therefore, the floating point constants/immediate values are conventionally loaded directly from memory or formed in their entirety by customized instructions for generating the desired floating point constants. Some approaches may also include hard-coding specific floating point values such as 0.0, 1.0, and 2.0 in registers. As can be recognized, such conventional techniques for generating floating point constants result in increased latency, increased code size, and/or increased hardware.
Accordingly, there is a need in the art for overcoming the aforementioned limitations associated with floating point constants immediate values for floating point instructions.